<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/app/common/header.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>微型企业财政补助资金支付申请表</title>
		<link href="<%=basePath%>/app/main/style/inputpage.css"
			rel="stylesheet" type="text/css" />
	</head>
	<body>
		<form id="inputForm"
			action="<%=basePath%>app/sys/govmoney/govmoney!save" method="post">
			<input type="hidden" name="id" id="id" value="${id}" />
			<table width="100%" border="0" id="topSpace">
				<tr>
					<td></td>
				</tr>
			</table>
			<div id="edit">
				<table border="0" align="center" cellpadding="2" cellspacing="1" id="tableAddCon" width="90%">
					<tr>
						<th colspan="4" class="stitle">
							微型企业财政补助资金支付申请表
						</th>
					</tr>
					<tr>
						<th width='15%'>企业名称:</th>
						<td width='35%'>
							<s:select onchange="compChange(this.value)" name="entity.comp.id" list="comps" listKey="id" listValue="compName" headerKey="" headerValue="===请选择企业名称==="></s:select>
							<span style="font-size:12px;color:red"><s:fielderror fieldName="msg.compName" /></span>&nbsp;
						</td>
						<th width='15%'>企业负责人:</th>
						<td width='35%'>
							<span id="fuzheren"></span>&nbsp;
						</td>
					</tr>
					<tr>
						<th width='15%'>企业住所:</th>
						<td width='35%'>
							<span id="address"></span>&nbsp;
						</td>
						<th width='15%'>联系电话:</th>
						<td width='35%'>
							<span id="phone"></span>&nbsp;
						</td>
					</tr>
					<tr>
						<th width='15%'>开户银行:</th>
						<td width='35%'>
							<span id="bank"></span>&nbsp;
						</td>
						<th width='15%'>银行账号:</th>
						<td width='35%'>
							<span id="bankNo"></span>&nbsp;
						</td>
					</tr>
					<tr>
						<td colspan="4" align="center">财政补助资金支付意向</td>
					</tr>
					<tr>
						<th width='15%'>用途:</th>
						<td width='35%'>
							<input class="nestedText" type="text" style="width:98%" name="usefor" value="${usefor}"  />&nbsp;
						</td>
						<th width='15%'>金额（元）:</th>
						<td width='35%'>
							<input class="nestedText" type="text" style="width:98%" name="money" value="${money}" id="money"/>&nbsp;
						</td>
					</tr>
					<tr>
						<th width='15%'>支付对象全称:</th>
						<td width='35%'>
							<input class="nestedText" type="text" style="width:98%" name="compName" value="${compName}" id="compName1"/>&nbsp;
						</td>
						<th width='15%'>开户银行:</th>
						<td width='35%'>
							<input class="nestedText" type="text" style="width:98%" name="bank" value="${bank}"  id="bank1"/>&nbsp;
						</td>
					</tr>
					<tr>
						<th width='15%'>银行账号:</th>
						<td width='35%'>
							<input class="nestedText" type="text" style="width:98%" name="bankNo" value="${bankNo}" id="bankNo1" />&nbsp;
						</td>
						<th width='15%'>大写金额:</th>
						<td width='35%'>
							<input class="nestedText" type="text" style="width:98%" id="moneyBig" name="moneyBig" value="${moneyBig}"  />&nbsp;
						</td>
					</tr>
					<tr>
						<td width='100%' colspan="4" height="70px" align="center">
						承诺：本企业将严格按照以上支付意向通过开户银行主动办理财政补助资金的支付结算。<br>
						法定代表人：<input class="nestedText" type="text" id="chief" name="chief" value="${chief}"  /><span style="width:150px"></span>
						日期：<input class="Wdate" type="text" name="chenluoDate" value="<fmt:formatDate value="${chenluoDate}" pattern="yyyy-MM-dd"/>"  onfocus="WdatePicker()" />
						</td>
					</tr>
					<tr>
						<th width='15%'>工商所审查意见:</th>
						<td width='85%' colspan="3" height="100px">
							该企业在注册地已开业，正常从事
							<input class="nestedText" type="text" name="industry" id="industry" value="${industry}"  />经营活动。从业人员
							<input class="nestedText" type="text" name="empCount" value="${empCount}" id="empCount" style="width:50px"/>人，
							用于经营活动的主要设备（包括办公设备）有
							<input class="nestedText" type="text" name="equipment" value="${equipment}"  style="width:250px"/>
							。以上 <input class="nestedText" type="text" name="moneyWhat" value="${moneyWhat}"  />资金支付情况属实，建议支付。<br><br>
							巡查人员：<input class="nestedText" type="text" name="xuncha" value="${xuncha}"  /><span style="width:300px"></span>巡查时间：<input class="Wdate" type="text" name="xunchaDate" value="<fmt:formatDate value="${xunchaDate}" pattern="yyyy-MM-dd"/>"  onfocus="WdatePicker()" /><br>
							审核人员：<input class="nestedText" type="text" name="gscheckUser" value="${gscheckUser}"  /><span style="width:300px"></span>审核时间：<input class="Wdate" type="text" name="gscheckDate" value="<fmt:formatDate value="${gscheckDate}" pattern="yyyy-MM-dd"/>"  onfocus="WdatePicker()" /><br>
						</td>
					</tr>
					<tr>
						<th width='15%'>微企科审查意见:</th>
						<td width='85%' colspan="3" height="60px">
							审核人员：<input class="nestedText" type="text" name="microCheckUser" value="${microCheckUser}"  /><span style="width:300px"></span>审核时间：<input class="Wdate" type="text" name="microCheckDate" value="<fmt:formatDate value="${microCheckDate}" pattern="yyyy-MM-dd"/>"  onfocus="WdatePicker()" /><br>
							审核意见：<textarea class="nestedText" rows="2" cols="95" name="microNote">${microNote }</textarea>
						</td>
					</tr>
					<tr>
						<th width='15%'>区县微企办领导意见:</th>
						<td width='85%' colspan="3" height="60px">
							审核人员：<input class="nestedText" type="text" name="townCheckUser" value="${townCheckUser}"  /><span style="width:300px"></span>审核时间：<input class="Wdate" type="text" name="townCheckDate" value="<fmt:formatDate value="${townCheckDate}" pattern="yyyy-MM-dd"/>"  onfocus="WdatePicker()" /><br>
							审核意见：<textarea class="nestedText" rows="2" cols="95" name="townNote">${townNote }</textarea>
						</td>
					</tr>
					<tr>
      		<th align="center" colspan="4" style="padding:5px">
      					 <c:if test="${user.type eq 'high'}">
							<input type="submit" class="submit" value="提交" />
							</c:if>
							&nbsp;
							<input type="button" class="submit" value="返回"
								onclick="javascript:location.href='<%=basePath%>app/sys/govmoney/govmoney'" />
						</th>
					</tr>
				</table>

			</div>
			</div>
			
		</form>
		<div style="text-align:left;margin-left:20px">
		<span style="font-size:12px;color:red">
				备注：<br>
				1.一份申请书对应一笔财政补助资金支付事项，金额大小写须一致，内容涂改无效；<br>
				为便于印鉴核对，请加盖公章于空白处，勿压线、压字。<br>
				2.本表一式3份，申请企业、微企办、银行各留存1份，请在表头相应单位前打√。
			</span>
			</div>
			<script type="text/javascript">
				function compChange(id){
					$.ajax({
				 		  type: "POST",
						  cache: false,
						  url: "<%=basePath %>/app/sys/comp/comp!getCompInfo",
						  dataType: "json",
						  timeout: 30000,
						  data:{id:id},
						  success: function(json){
						  	$("#fuzheren").html(json.name);
						  	$("#address").html(json.address);
						  	$("#phone").html(json.phone);
						  	$("#bank").html(json.bankAddress);
						  	$("#bankNo").html(json.bankNo);

						  	var id = $("#id").val();
							if(id==""){
								//只有是新增的时候才为以下几项赋值
								$("#compName1").val(json.compName);
							  	$("#bank1").val(json.bankAddress);
							  	$("#bankNo1").val(json.bankNo);
							  	$("#chief").val(json.name);
							  	$("#industry").val(json.industry);
							  	$("#empCount").val(json.empCount);
							}

							<c:if test="${user.type eq 'low'}">
								$("#phone").html("***");
							  	$("#bank").html("***");
							  	$("#bankNo").html("***");
							  	$("#bank1").val("***");
							  	$("#bankNo1").val("***");
							 </c:if>
						  }, 
						  error:function(){
						  		Ext.MessageBox.show({
						           title: '提示',
						           msg: '请求失败或超时，请稍后再试！',
						           buttons: Ext.MessageBox.OK,
						           icon: Ext.MessageBox.WARNING
						       });
								return;
						  }	
				 	});
				}

				$(function(){
					var id = $("#id").val();
					if(id!=""){
						compChange(id);
					}

					$("#money").blur(function(){
						var v = $(this).val();
						$("#moneyBig").val(DX(v));
					});

					 
				}); 

				function DX(n) {
			        if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n))
			            return "数据非法";
			        var unit = "千百拾亿千百拾万千百拾元角分", str = "";
			            n += "00";
			        var p = n.indexOf('.');
			        if (p >= 0)
			            n = n.substring(0, p) + n.substr(p+1, 2);
			            unit = unit.substr(unit.length - n.length);
			        for (var i=0; i < n.length; i++)
			            str += '零壹贰叁肆伍陆柒捌玖'.charAt(n.charAt(i)) + unit.charAt(i);
			        return str.replace(/零(千|百|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
				}
			</script>
	</body>
</html>
